-- 房间模块
-- Author: Colocasia
-- Date: 2018-08-07

local skynet = require 'skynet';
local us = require 'us';
local class = require 'class';
local handler = require 'handler';
local table = require 'us.table';

local M = class('room', handler);


---常用函数
---@type fun @合并表内容
local table_merge = table.merge;

---管理器地址
local mgr_addr;

---房间基本数据结构
local room = {
    id      = 0,                            -- 房间编号
    cuid    = 0,                            -- 客户端编号
    guid    = '',                           -- 房间GUID
    players = {},                           -- 房间玩家
}


---构造函数
function M:ctor()
    table_merge(self, room);
end


---初始化
function M:init(addr, id)
    mgr_addr = addr;
    self.id = id;
end


---获得room_id
function M:get_id()
    return self.id;
end


---设置cuid
function M:set_cuid(cuid)
    self.cuid = cuid;
end




return M;
